function [ top1Rate, top3Rate ] = topRate( Y_est, Y )
%TOPRATE Summary of this function goes here
%   Detailed explanation goes here
[N,L] = size(Y);
[maxV3,maxI3] = sort(Y_est,2,'descend');
count1 = 0;
count3 = 0;
for i = 1:N
%         count1 = count1+sum(Y(i,maxI3(i,1))+1)/2;
%         count3 = count3+sum(Y(i,maxI3(i,1:3))+1)/2;
        count1 = count1+Y(i,maxI3(i,1));
        count3 = count3+sum(Y(i,maxI3(i,1:3)));

end
top1Rate = count1/N;
top3Rate = count3/3/N;
display(top1Rate);
display(top3Rate);
end


